package com.zhentao.product.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhentao.login.utils.Result;
import com.zhentao.nlz.project.dto.DictionaryDto;
import com.zhentao.nlz.project.product.TDictionary;
import com.zhentao.product.mapper.TDictionaryMapper;
import com.zhentao.product.service.TDictionaryService;
import org.springframework.stereotype.Service;

/**
* @author 不.凌
* @description 针对表【t_dictionary(字典表)】的数据库操作Service实现
* @createDate 2024-09-22 21:09:18
*/
@Service
public class TDictionaryServiceImpl extends ServiceImpl<TDictionaryMapper, TDictionary>
    implements TDictionaryService{

    @Override
    public Result PagetDictionary(DictionaryDto dto) {
        Page<TDictionary> page = new Page<>(dto.getPageNum(), dto.getPageSize());
        LambdaQueryWrapper<TDictionary> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(StringUtils.checkValNotNull(dto.getType()), TDictionary::getType, dto.getType());
        this.page(page, wrapper);
        return Result.success(page);
    }
}




